package com.zhaozhaonews.search.controller.v1;


import com.zhaozhaonews.model.common.dto.ResponseResult;
import com.zhaozhaonews.model.serach.dto.UserSearchDto;
import com.zhaozhaonews.search.service.ArticleSearchService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @author WanJl
 * @version 1.0
 * @title ArticleSearchController
 * @description 搜索新闻接口
 * @create 2025/2/21
 */
@RestController
@RequestMapping("/api/v1/article/search")
public class ArticleSearchController {

    @Resource
    private ArticleSearchService articleSearchService;

    @PostMapping("/search")
    public ResponseResult search(@RequestBody UserSearchDto dto) throws IOException {
        return articleSearchService.search(dto);
    }

}
